PROPERTIES = set(['user', 'scene', 'url'])

def build(**kwargs):
	query = ['SELECT * FROM logs']
        args = list(set(kwargs.keys()) & PROPERTIES)
        values = list(kwargs.get(a) for a in args)
        if args:
            query.append('WHERE %s' % ' AND '.join('%s %s %s' %
						   (a, 'LIKE' if '%' in kwargs.get(a) else '=', "%s")
						   for a in args))
	return ' '.join(query), values
